﻿@using GigaSite.Domain.Entities
@using GigaSite.Domain.IoC
@using GigaSite.Web.Classes
@using GigaSite.Web.Models
@{
    Layout = "../../../../Views/Shared/_Layout.cshtml";
    Category category = ViewBag.category;
    ViewBag.Title = category.DisplayName;
    int activeTabIndex = ViewBag.activeTabIndex;
    string categoryUrlFormat = ViewBag.categoryUrlFormat;
    Func<Category, int> itemsCountSelector = ViewBag.itemsCountSelector;
}

<div class="page">
    @* Навигационная цепочка *@
    @Html.NavigationChain()
    
    @* Верхий тулбар *@
    <div class="topBar">
        <div class="add">
            @Html.ActionLink("Добавить объявление","CreateAds")
        </div>
    </div>
    
    @* Вкладки *@
    <div class="tabs">
        <ul class="nav nav-tabs">
            <li>@Html.ActionLink("Топ","Top")</li>
            <li class="@(activeTabIndex == 1 ? "active" : "")">@Html.ActionLink("Авто / мото","Auto")</li>
            <li class="@(activeTabIndex == 2 ? "active" : "")">@Html.ActionLink("Бизнес","Business")</li>
            <li class="@(activeTabIndex == 3 ? "active" : "")">@Html.ActionLink("Купля / продажа","Trade")</li>
            <li class="@(activeTabIndex == 4 ? "active" : "")">@Html.ActionLink("Недвижимость","RealEstate")</li>
            <li class="@(activeTabIndex == 5 ? "active" : "")">@Html.ActionLink("Строительство","Construction")</li>
            <li class="@(activeTabIndex == 6 ? "active" : "")">@Html.ActionLink("Услуги","Services")</li>
            <li class="@(activeTabIndex == 7 ? "active" : "")">@Html.ActionLink("Другое","Misc")</li>
            <li class="@(activeTabIndex == 8 ? "active" : "")">@Html.ActionLink("Архив","Archive")</li>
        </ul>
    </div>
    @* Строка поиска и фильтра *@
    @Html.Partial("ContainerSearch")
    
    @* Рекоммендации по объявлениям *@
    @Html.Partial("AdsRecommendations")
    
    @* Категории в текущем разделе *@
    @Html.Partial("DynamicCategories",new CategoriesHtmlHelperModel()
                                            {
                                                Categories = category.GetChildCategories(),
                                                UrlFormat = categoryUrlFormat,
                                                ItemsCountSelector = itemsCountSelector
                                            })
</div>
